<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title', 255)->comment('商品标题');
            $table->double('price', 10, 2)->comment('商品价格');
            $table->string('cover', 255)->comment('商品封面');
            $table->string('platform', 20)->comment('商品所属平台');
            $table->string('external_link', 255)->nullable()->comment('商品所属外部链接');
            $table->tinyInteger('is_active')->default(1)->comment('是否有效 1有效 0无效');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
